package com.module.my.adapter.holder.vip

import android.view.ViewGroup
import com.module.base.base.adapter.BaseViewHolder
import com.module.my.R
import com.module.my.bean.VipContentBean
import com.module.my.databinding.MyItemVipContentBinding
import skin.support.content.res.SkinCompatResources

class VipContentHolder(parent: ViewGroup) :
    BaseViewHolder<VipContentBean, MyItemVipContentBinding>(parent) {
    override fun convert(bean: VipContentBean, position: Int) {
        mDatabind.tvName.let {
            it.paint.isFakeBoldText = bean.isTitle
            it.textSize = (if (bean.isTitle) 15f else 12f) as Float
            it.text = bean.name1
            it.setTextColor(
                if (bean.colorRes1 == 0) SkinCompatResources.getColor(
                    context,
                    R.color.bg_item_content
                ) else context.resources.getColor(bean.colorRes1)
            )
        }
        mDatabind.tvNormal.let {
            it.paint.isFakeBoldText = bean.isTitle
            it.textSize = (if (bean.isTitle) 15f else 12f) as Float
            it.text = bean.name2
            it.setTextColor(
                if (bean.colorRes2 == 0) SkinCompatResources.getColor(
                    context,
                    R.color.bg_item_content
                ) else context.resources.getColor(bean.colorRes2)
            )
        }
        mDatabind.tvVip.let {
            it.paint.isFakeBoldText = bean.isTitle
            it.textSize = (if (bean.isTitle) 15f else 12f) as Float
            it.text = bean.name3
            it.setTextColor(
                if (bean.colorRes3 == 0) SkinCompatResources.getColor(
                    context,
                    R.color.bg_item_content
                ) else context.resources.getColor(bean.colorRes3)
            )

        }

    }
}